{% import "macro.html.twig" as web_macro %}
<!DOCTYPE html>
<!--[if lt IE 7]>
<html class="lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>
<html class="lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>
<html class="lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!-->
<html> <!--<![endif]-->

{% set lang = app.request.getLocale() %}
{% set mobile = is_show_mobile_page() %}

{% set currentTheme = current_theme() %}
{% set themeConfig = app.request.get('themeEditing')|default(false) ? currentTheme.config  : currentTheme.confirmConfig %}
{% set maincolor = themeConfig.maincolor|default('default') %}
{% set navigationcolor = themeConfig.navigationcolor|default('default') %}

<html lang="{{ lang }}" class="{% if lang == 'en' %}es-en{% endif %}">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1">
  <meta name="renderer" content="webkit">
  <meta name="viewport"
    content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
  <title>
    {%- block title -%}
      {{ setting('site.name', 'EduSoho') }}{% if setting('site.slogan') %} - {{ setting('site.slogan') }}{% endif %}{% if  setting('copyright.owned','0') != '1' or setting('copyright.thirdCopyright')|default(0) == 2 %} - Powered By EduSoho{% endif %}
    {%- endblock -%}
  </title>
  {% block meta %}
    <meta name="keywords"
          content="
{% spaceless %}{% block keywords %}{{ setting('site.seo_keywords') }}{% endblock %}{% endspaceless %}"/>
    <meta name="description"
          content="{% spaceless %}{% block description %}{{ setting('site.seo_description') }}{% endblock %}{% endspaceless %}"/>
    <meta name="format-detection"
          content="{% spaceless %}{% block format_detection %}{% endblock %}{% endspaceless %}"/>
    <meta content="{{ csrf_token('site') }}" name="csrf-token"/>
    <meta content="{{ app.user.isLogin()|default(0) }}" name="is-login"/>
    <meta content="{{ wechat_login_bind_enabled()|default(0) }}" name="wechat_login_bind"/>
  {% endblock %}


  {{ setting('login_bind.verify_code', '')|raw }}
  {% if setting('site.favicon') %}
    <link rel="icon" href="{{ asset(setting('site.favicon')) }}" type="image/x-icon"/>
    <link rel="shortcut icon" href="{{ asset(setting('site.favicon')) }}" type="image/x-icon" media="screen"/>
  {% endif %}

  <!--[if lt IE 9]>
  <script src="{{ asset('static-dist/libs/html5shiv.js') }}"></script>
  <script src="{{ asset('static-dist/es5-shim/es5-shim.js') }}"></script>
  <script src="{{ asset('static-dist/es5-shim/es5-sham.js') }}"></script>
  <![endif]-->

  {% block stylesheets %}
    {% include 'css_loader.html.twig' %}
    {% include 'default/stylesheet-webpack.html.twig' %}
  {% endblock %}

  {% block head_scripts %}{% endblock %}
</head>
<body class="{% block bodyClass %}{{ 'es-main-' ~ maincolor }} {{ 'es-nav-' ~ navigationcolor }} {% if bodyClass|default('') %}{{ bodyClass }}{% endif %}{% endblock %}">

<!--[if lt IE 9]>
<script src="{{ asset('static-dist/libs/fix-ie.js') }}"></script>
{% include 'default/ie8-alert.html.twig' %}
<![endif]-->

{% block body %}
  <div class="es-wrap">

    {% block header %}
      {% include 'site-hint.html.twig' %}
      {% include 'default/header.html.twig' %}
      {% include 'default/exception.html.twig' %}
    {% endblock %}

    {% block full_content %}
      {% block top_content %}{% endblock %}

      <div id="content-container" class="container">
        {% block content %}{% endblock %}
      </div>

      {% block bottom_content %}{% endblock %}
    {% endblock %}

    {% block footer %}
      {% include 'default/footer.html.twig' %}
    {% endblock %}

    {% block footer_mobile %}
    {% endblock %}

    {% block bottom %}{% endblock %}
  </div>

  {% block esBar %}
    {% if setting('esBar.enabled', 0) %}
      {% include 'es-bar/index.html.twig' %}
    {% endif %}
  {% endblock %}

  {% block floatConsult %}
  
    {% set cloudConsultPath = cloudConsultPath() %}
    {% if cloudConsultPath|default() %}
      {{ cloudConsultPath | raw }}
    {% endif %}

    {% if setting('consult.enabled', 0) and (consultDisplay|default(false) or siteNav|default() == '/' ) %}
      {% if not setting('esBar.enabled',0) %}
        {% include 'float-consult.html.twig' %}
      {% endif %}
    {% endif %}
  {% endblock %}

  <div id="login-modal" class="modal" data-url="{{ path('login_ajax') }}"></div>
  <div id="modal" class="modal"></div>
  <div id="attachment-modal" class="modal"></div>

  {% set reward_notify = pop_reward_point_notify() %}
  {% if reward_notify %}
    <div class="hidden" id="rewardPointNotify">
      {{ reward_notify }}
    </div>
  {% endif %}

{% endblock %}

{% block footer_script %}
  {% include 'default/script-webpack.html.twig' %}
  {% include 'script_boot.html.twig' %}
{% endblock %}

</body>
</html>